function Person(name) {
    this.name = name;
    Person.prototype.say = function () {
        console.log('我是父级');
    }
}

function myNew(...args) {
    var [constructor, ...params] = args;
    var obj = {};
    obj.__proto__ = constructor.prototype;
    var res = constructor.apply(obj, params);
    var flag = Object.prototype.toString.call(res).includes('Object');
    return flag?res:obj;
}
var p1 = new Person('子级');
var p2 = myNew(Person, '张三');